package com.gp.model.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 
 * </p>
 *
 * @author 弓成龙
 * @since 2017-11-26
 */
@TableName("base_user")
@ApiModel
public class BaseUser{

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "id", required = false)
  @NotNull(groups = ID.class)
  private Long id;
  @ApiModelProperty(value = "phone", required = false)
  private String phone;
  @ApiModelProperty(value = "nickName", required = false)
  private String nickName;
  @ApiModelProperty(value = "loginPassword", required = false)
  @NotBlank(message = "{EMPTY_LOGIN}")
  private String loginPassword;
  @ApiModelProperty(value = "pic", required = false)
  /** 头像 **/
  private String pic;
  @ApiModelProperty(value = "loginName", required = false)
  @NotBlank(message = "{EMPTY_LOGIN}")
  private String loginName;
  @ApiModelProperty(value = "gender", required = false)
  private Integer gender;
  @ApiModelProperty(value = "state", required = false)
  /** 0： 正常 1：失效 **/
  private Integer state;
  @ApiModelProperty(value = "currentType", required = false)
  /** 标识当前的用户等级 **/
  private String currentType;
  @ApiModelProperty(value = "auditState", required = false)
  /** 0 ： 未审核 1:审核 **/
  private Integer auditState;
  @ApiModelProperty(value = "userType", required = false)
  /** 0： 管理员 1： 分销商 **/
  private Integer userType;
  @ApiModelProperty(value = "lastLoginTime", required = false)
  private Date lastLoginTime;
  @ApiModelProperty(value = "lastLoginIP", required = false)
  private String lastLoginIP;
  /**
   * 自定义填充的创建时间
   */
  @TableField(fill = FieldFill.INSERT) // 该注解插入忽略验证，自动填充
  private Date createTime;
  /**
   * 自定义填充的最后一次修改时间
   */
  @TableField(fill = FieldFill.UPDATE) // 该注解插入忽略验证，自动填充
  private Date lastModifiedTime;

  public BaseUser() {}

  public BaseUser(String authenticationUsername, String authenticationPassword,String userType) {
    this.loginName = authenticationUsername;
    this.loginPassword = authenticationPassword;
    this.userType = Integer.parseInt(userType);
  }
  
  public BaseUser(String authenticationUsername, String authenticationPassword) {
    this.loginName = authenticationUsername;
    this.loginPassword = authenticationPassword;
  }
  
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String getNickName() {
    return nickName;
  }

  public void setNickName(String nickName) {
    this.nickName = nickName;
  }

  public String getLoginPassword() {
    return loginPassword;
  }

  public void setLoginPassword(String loginPassword) {
    this.loginPassword = loginPassword;
  }

  public String getPic() {
    return pic;
  }

  public void setPic(String pic) {
    this.pic = pic;
  }

  public String getLoginName() {
    return loginName;
  }

  public void setLoginName(String loginName) {
    this.loginName = loginName;
  }

  public Integer getGender() {
    return gender;
  }

  public void setGender(Integer gender) {
    this.gender = gender;
  }

  public Integer getState() {
    return state;
  }

  public void setState(Integer state) {
    this.state = state;
  }

  public String getCurrentType() {
    return currentType;
  }

  public void setCurrentType(String currentType) {
    this.currentType = currentType;
  }

  public Integer getAuditState() {
    return auditState;
  }

  public void setAuditState(Integer auditState) {
    this.auditState = auditState;
  }

  public Integer getUserType() {
    return userType;
  }

  public void setUserType(Integer userType) {
    this.userType = userType;
  }

  public Date getLastLoginTime() {
    return lastLoginTime;
  }

  public void setLastLoginTime(Date lastLoginTime) {
    this.lastLoginTime = lastLoginTime;
  }

  public String getLastLoginIP() {
    return lastLoginIP;
  }

  public void setLastLoginIP(String lastLoginIP) {
    this.lastLoginIP = lastLoginIP;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getLastModifiedTime() {
    return lastModifiedTime;
  }

  public void setLastModifiedTime(Date lastModifiedTime) {
    this.lastModifiedTime = lastModifiedTime;
  }

  public static long getSerialversionuid() {
    return serialVersionUID;
  }

  public interface ID {
  }

}
